<?php use \Inationsoft\NS; use \Inationsoft\NS\UI\Widget; ?> 
<form method="post" action="<?php echo $app_base_url; ?>/index">
<div class="breadcrumbwidget">
	<ul class="breadcrumb">
		<li><a href="http://localhost/~inanta/simtur">Beranda</a> <span class="divider">/</span></li>
		<li class="active">Tautan Menu</li>
	</ul>
</div><!--breadcrumbs-->
<div class="pagetitle">
	<div class="row-fluid">
		<div class="span6"><h1>Tautan Menu</h1><span>Tautan Menu</span></div>
		<div class="span6">
			<div id="header-button">
				<?php echo new Widget\Hidden('token', $token); ?> 
				<ul>
					<li><?php echo new Widget\Bootstrap\HyperlinkButton(null, $app_base_url . '/insert/' . $mid, '<span class="icon-pencil"></span> Tambah'); ?></li>
					<li><?php echo new Widget\Bootstrap\Button('dispatch', 'delete', Widget\Button::BUTTON_NORMAL, '<span class="icon-trash"></span> Hapus', array('id' => 'button-delete')); ?></li>
					<li><?php echo new Widget\Bootstrap\HyperlinkButton(null, NS_BASE_URL . '/' . CMS_ENGINE . '/menu/index', '<span class="icon-arrow-left"></span> Kembali'); ?></li>
				</ul>
			</div>	
		</div>
	</div>
</div><!--pagetitle-->

<div class="maincontent">
	<div class="contentinner">
		<div class="form-wrapper">
			<table class="data-list table table-bordered">
				<thead>
					<tr class="table-pre">
						<td colspan="5">
							Tampilkan: <?php echo new Widget\ListBox('page_limit', array('5' => '5', '15' => '15', '100' => '100', '0' => 'Semua'), $page_limit); ?>&nbsp;<?php echo new Widget\ListBox('search_column', array('url' => 'URL', 'name' => 'Menu Item Name', 'enabled' => 'Enabled')) ?>&nbsp; 
							<?php echo new Widget\Text('search_keyword', $search_keyword) ?>&nbsp;<?php echo new Widget\Bootstrap\Button('dispatch', 'page_limit', Widget\Button::BUTTON_SUBMIT, '<span class="icon-search"></span> Cari'); ?> 
						</td>
					</tr>
					<tr>
						<th class="align-center">
							<?php echo new Widget\CheckBox('id', null, false, null, array('class' => 'checkall')); ?> 
						</th>
						<th>URL</th>
						<th>Menu Item Name</th>
						<th>Enabled</th>
						<th class="align-center">Tindakan</th>
					<tr>
				</thead>
				<tbody>
					<?php $counter = 0; ?>
					<?php foreach($datas as $data): ?>
					<?php if($counter % 2 == 0): ?>
					<tr class="alternate-row">
					<?php else: ?>
					<tr>
					<?php endif; ?>
						<td class="align-center">
							<?php echo new Widget\CheckBox('mlid[]', $data['mlid'], false, null, array('class' => 'mlid')); ?>
						</td> 
						<td><?php echo $data['url']; ?></td>
						<td><?php echo $data['menu_link_name']; ?></td>
						<td><?php echo $data['enabled']; ?></td>
						<td class="align-center action-button">
							<?php echo new Widget\Bootstrap\DropdownButton('actions', array(
								'<span class="icon-tasks"></span> Detail' => $app_base_url . '/detail/' . $data['mlid'],
								'<span class="icon-edit"></span> Rubah' => $app_base_url . '/edit/' . $data['mlid'],
								new Widget\Hyperlink(null, $app_base_url . '/detail/' . $data['mlid'] . '/true',
								'<span class="icon-print"></span> Cetak', array('target' => '_blank'))), true);
							?> 
						</td>
					</tr>
					<?php ++$counter; ?>
					<?php endforeach; ?> 
				</tbody>
				<tfoot>
					<tr class="table-pos">
						<td colspan="2">
							<?php echo ($data_count == 0 ? 'Data tidak ditemukan' : ($page_limit == 0 ? sprintf('Menampilan data 1 sampai %s dari total %s data', $data_count, $data_count) : sprintf('Menampilan data %s sampai %s dari total %s data', ((($page * $page_limit) - $page_limit) + 1), (($page * $page_limit) > $data_count ? $data_count : ($page * $page_limit)), $data_count))) ?> 
						</td>
						<td colspan="3" class="align-right">
							<?php echo new Widget\Paginator('pager', $data_count, $page, $page_limit, $app_base_url . '/index/' . $page_limit . '/'); ?> 
						</td>
					</tr>
				</tfoot>
			</table>
		</div>

		<div id="popup-delete"></div>
		<?php NS\UI\ScriptManager::getInstance()->addScript('jQuery(document).ready(function() { jQuery("#button-delete").click(function() { confirmDelete("Please select item you want to delete", "Are you sure want to delete {0} item(s)?", "' . $app_base_url . '/delete"); }); });'); ?>	</div><!--contentinner-->
</div><!--maincontent-->
</form>